// structrectfunction1.c
// gcc structrectfunction1.c

#include <stdio.h>
#include <stdlib.h>

struct point {
    int x;
    int y;
};

struct rect {
    struct point p1;
    struct point p2;
};

// function prototype
struct point makePoint(int x, int y);

int main()
{
    struct rect screen;
    
    screen.p1 = makePoint(5,2);
    screen.p2 = makePoint(50,20);
    
    printf("screen p1( %d , %d )\n", screen.p1.x , screen.p1.y);
    printf("screen p2( %d , %d )\n", screen.p2.x , screen.p2.y);
    printf("\n");
    
    printf("\n");
    system("pause");
    return 0;
}

struct point makePoint(int x, int y)
   {
       struct point temp;
       temp.x = x;
       temp.y = y;
       return temp;
}